# -*- coding: utf-8 -*-
"""
Created on Mon Oct  7 17:04:03 2020

@author: Erfan
"""
from casadi import*
import numpy as np
from Parameters import *
from Model import *
import random

Nr,Nt,Nz,dr,dt,dz,Np,NN,Nx,Nw,Ny,Nv=circular_parameters()
DeltaT,Nsim=time_parameters()

x=SX.sym('x',Nx)
w=SX.sym('w',Nw)
u=SX.sym('u',1)
i=SX.sym('i',1)
Kc=SX.sym('Kc',1)
Et0=SX.sym('Et0',1)

def pre_jacobian(x,u,w,i,Kc,Et0):
    
    F = ode_CP2(x,u,w,i,Kc,Et0)
    F_jacx=jacobian(F,x)
    F_jacu=jacobian(F,u)
    
    return F_jacx,F_jacu

F_symbol1=pre_jacobian(x,u,w,i,Kc,Et0)[0]
F_symbol2=pre_jacobian(x,u,w,i,Kc,Et0)[1]

F1=Function('F1',[x,u,w,i,Kc,Et0],[F_symbol1])
F2=Function('F2',[x,u,w,i,Kc,Et0],[F_symbol2])
    
